#include "stdafx.h"
#include "wf_zoomredraw.h"


/**
 * Constructor.
 *
 * @param keepAspectRatio true: keep same zoom value for x/y.
 *                        false: adjust both x and y individually
 */
WF_ZoomRedraw::WF_ZoomRedraw(PF_Container& container,
        PF_GraphicView& graphicView)
        :PF_ActionInterface("Redraw", container, graphicView) {
}


QAction* WF_ZoomRedraw::createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/) {
	// tr("Redraw")
	QAction* action = new QAction(tr("&Redraw"), NULL);
#if QT_VERSION >= 0x040600
        action->setIcon(QIcon::fromTheme("view-refresh", QIcon(":/actions/zoomredraw.png")));
#else
        action->setIcon(QIcon(":/actions/zoomredraw.png"));
#endif
        action->setShortcut(QKeySequence::Cut);
	//action->zetStatusTip(tr("Redraw"));
	
    return action;
}


void WF_ZoomRedraw::init(int status) {
    PF_ActionInterface::init(status);
    trigger();
}



void WF_ZoomRedraw::trigger() {
    graphicView->redraw();
    finish();
}

// EOF
